<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateOrderActionTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('order_action', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('order_id')->comment('订单ID');
            $table->unsignedBigInteger('user_id')->default(0)->comment('操作用户ID,0为系统自动操作');
            $table->string('user_type')->nullable()->comment('用户类型');
            $table->unsignedBigInteger('shop_id')->comment('店铺ID');
            $table->unsignedTinyInteger('status')->default(1)->comment('订单状态');
            $table->unsignedTinyInteger('pay_status')->default(1)->comment('付款状态');
            $table->unsignedTinyInteger('is_shipping')->default(0)->comment('是否发货|["否","是"]');
            $table->string('remark')->nullable()->comment('操作备注');
            $table->string('desc')->nullable()->comment('操作描述');
            $table->timestampsTz();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('order_action');
    }
}
